package com.ruoyi.slope.video.crack.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.slope.video.crack.mapper.SlopeSurfaceCrackMonitorMapper;
import com.ruoyi.slope.video.crack.domain.SlopeSurfaceCrackMonitor;
import com.ruoyi.slope.video.crack.service.ISlopeSurfaceCrackMonitorService;

/**
 * 地表裂缝监测Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-25
 */
@Service
public class SlopeSurfaceCrackMonitorServiceImpl implements ISlopeSurfaceCrackMonitorService 
{
    @Autowired
    private SlopeSurfaceCrackMonitorMapper slopeSurfaceCrackMonitorMapper;

    /**
     * 查询地表裂缝监测
     * 
     * @param id 地表裂缝监测主键
     * @return 地表裂缝监测
     */
    @Override
    public SlopeSurfaceCrackMonitor selectSlopeSurfaceCrackMonitorById(Long id)
    {
        return slopeSurfaceCrackMonitorMapper.selectSlopeSurfaceCrackMonitorById(id);
    }

    /**
     * 查询地表裂缝监测列表
     * 
     * @param slopeSurfaceCrackMonitor 地表裂缝监测
     * @return 地表裂缝监测
     */
    @DataScope(deptAlias = "s")
    @Override
    public List<SlopeSurfaceCrackMonitor> selectSlopeSurfaceCrackMonitorList(SlopeSurfaceCrackMonitor slopeSurfaceCrackMonitor)
    {
        return slopeSurfaceCrackMonitorMapper.selectSlopeSurfaceCrackMonitorList(slopeSurfaceCrackMonitor);
    }

    /**
     * 新增地表裂缝监测
     * 
     * @param slopeSurfaceCrackMonitor 地表裂缝监测
     * @return 结果
     */
    @Override
    public int insertSlopeSurfaceCrackMonitor(SlopeSurfaceCrackMonitor slopeSurfaceCrackMonitor)
    {
        slopeSurfaceCrackMonitor.setCreateTime(DateUtils.getNowDate());
        return slopeSurfaceCrackMonitorMapper.insertSlopeSurfaceCrackMonitor(slopeSurfaceCrackMonitor);
    }

    /**
     * 修改地表裂缝监测
     * 
     * @param slopeSurfaceCrackMonitor 地表裂缝监测
     * @return 结果
     */
    @Override
    public int updateSlopeSurfaceCrackMonitor(SlopeSurfaceCrackMonitor slopeSurfaceCrackMonitor)
    {
        slopeSurfaceCrackMonitor.setUpdateTime(DateUtils.getNowDate());
        return slopeSurfaceCrackMonitorMapper.updateSlopeSurfaceCrackMonitor(slopeSurfaceCrackMonitor);
    }

    /**
     * 批量删除地表裂缝监测
     * 
     * @param ids 需要删除的地表裂缝监测主键
     * @return 结果
     */
    @Override
    public int deleteSlopeSurfaceCrackMonitorByIds(Long[] ids)
    {
        return slopeSurfaceCrackMonitorMapper.deleteSlopeSurfaceCrackMonitorByIds(ids);
    }

    /**
     * 删除地表裂缝监测信息
     * 
     * @param id 地表裂缝监测主键
     * @return 结果
     */
    @Override
    public int deleteSlopeSurfaceCrackMonitorById(Long id)
    {
        return slopeSurfaceCrackMonitorMapper.deleteSlopeSurfaceCrackMonitorById(id);
    }
}
